Local npm module cannot be found - npm

In a React Boilerplate project, I am trying to use a local module, but getting:
ERROR in ./node_modules/react-sortable-tree-theme-file-explorer/dist/main.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/username/Documents/project/node_modules/react-sortable-tree-theme-file-explorer/dist/main.js'
Both paths do exist:
$ ls node_modules/react-sortable-tree-theme-file-explorer/dist/main.js
node_modules/react-sortable-tree-theme-file-explorer/dist/main.js
and
$ ls /Users/username/Documents/project/node_modules/react-sortable-tree-theme-file-explorer/dist/main.js
/Users/username/Documents/project/node_modules/react-sortable-tree-theme-file-explorer/dist/main.js
...so I can't figure out what the complaint is. The paths and files DO EXIST. I used npm link initially, but that never worked, and so I also tried npm install ../react-sortable-tree-theme-file-explorer but it gives the exact same results.
I am importing the package as in:
import FileExplorerThemeBase from "react-sortable-tree-theme-file-explorer";

Related

What is sproj file?

When running MSBuld prior to setting up my NPM install task, I get an error that the files that NPM would install are missing. The line number of the error is from a file named \sproj. VSCode can not find the file when clicking on it and I don't have a file by that name in my project. What is this file?

Using npm link returns error "Not Found - GET https://registry.npmjs.org/"

I am trying to link a local dependency of scss styles to a project using npm link. Following the docs I run npm link in the dependencies directory, which tells me:
/usr/local/lib/node_modules/xxx/xyz -> /xxx/xxx/xxx/xxx/xxx/xyz
The I got to my project directory and run npm link xyz but it give the error:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/xyz - Not found
So it is not finding the symlink and searching npm.
I have read that this can be caused by using nvm with different versions of node but this is not the case for me.
How can I successfully link the package?
You can link the package manually:
pacakge.json
"package": "package#*"
Project that requires the dependency
create a symbolic link to the local dependency
cd node_modules
ln -nfs ../relative/path/to/local/package

Cannot find module 'jquery.tagsinput-revisited

I've installed jquery.tagsinput-revisited via npm, which was provided here
npm i jquery.tagsinput-revisited
Then, I've added
require('jquery.tagsinput-revisited');
in one of my js file and
#import '~jquery.tagsinput-revisited/src/jquery.tagsinput-revisited';
in one of SCSS file.
Now, I'm having these error while npm run watch
This dependency was not found:
jquery.tagsinput-revisited in ./resources/js/bundle1.js
To install it, you can run: npm install --save
jquery.tagsinput-revisited
ERROR in ./resources/js/bundle1.js Module not found: Error: Can't
resolve 'jquery.tagsinput-revisited' in
'C:\xampp\htdocs\vetforum\www\resources\js' #
./resources/js/bundle1.js 9:0-37 # multi ./resources/js/bundle1.js
SCSS file get successfully compiled,but there seems an error in the js file.
After several attempts, i've done like this
In JS file
require('../vendors/tagsinput/jquery.tagsinput-revisited');
In SCSS file
#import '../vendors/tagsinput/jquery.tagsinput-revisited';

AURELIA-CLI : how to use node module 'crypto' with aurelia-cli loader

I have an AURELIA application that uses the node module 'crypto'.
It works fine with GULP/JSPM (after 'npm install crypto' and 'jspm install crypto').
Now I want to use aurelia-cli instead of JSPM.
But I didn't succeed to load 'crypto' with the Aurelia-cli.
When building the app with 'au build' I got the error:
Error: ENOENT: no such file or directory, open '......\src\crypto.js'
I certainly need to reference 'crypto' in aurelia.json file but I don't find what to insert in this file.
Thanks if somebody could provide aurelia.json content for using crypto.

Less file watcher in PhpStorm produces: lessc: ENOENT: no such file or directory

I am trying to set up an file watcher for .less files, but it isn't working.
I have globally installed less via npm (npm install -g less). And after this I set up the file watcher according to this documentation from JetBrains supprt. Here is a picture of the settings:
Everytime I will change my .less files, it will produce the following error:
/usr/local/lib/node_modules/less/bin/lessc --no-color styles.less
lessc: ENOENT: no such file or directory, open '/Applications/PhpStorm.app/Contents/bin/styles.less'
Process finished with exit code 1
What went wrong? Any suggestions?
Using the less compiler directly in the project folder via the command line works perfectly (e.g. $ lessc styles.less styles.css)
Using the less compiler directly in the project folder via the command -- line works perfectly (e.g. $ lessc styles.less styles.css)
Try doing the same then -- please try with $FileDir$ in the "Working Directory" field.