Im getting this error trying to install dependencies from bower.json (bower install) and i don't know what is it or how i can fix it... any help would be apreciated.
✘ deniz946#UbuntuOS ~/Desktop/meanapp/client resourcejs bower install
/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/home/deniz946/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at Object.create.all.get (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
at Object.Configstore (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:28:44)
at readCachedConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
This command should work . It provide permission to bower configration.
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
and also give permission to folder by
sudo chmod -R 777 foldername
.
You are facing access permissions error. Use sudo:
sudo bower install
EDIT:
sudo does not seem to be working with bower install. This works for me though:
bower install --allow-root
For a more exotic take, where you are running as root in Docker and experiencing this, one should know that NPM is running as the owner of the current working directory. So in case you are root and does not work no matter what you try, try listing the files and see if they are owned by root. If not, it will never work, unless you change the ownership to root.
See this answer for the full explanation and references to source code in NPM.
Related
Whenever I try to run such commands as expo init or expo start or even just expo, it responds with:
Error: Cannot find module 'minizlib'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/create.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Extract.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Api.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/xdl.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
I have tried install and reinstalling minizlib, along with expo, expo-cli, npm, and node and nothing has worked.
Any help would be appreciated.
OS: Ubuntu 18.04.2
I had the same issue. I downgraded to version 10 of node using nvm install 10 (If you do not have NVM look into it here it is very useful) then reinstalled the expo-cli with npm install -g expo-cli. This ended up solving the issue for me.
Note: This downgrade is temporary if you want to make it your default version you have to run nvm alias default 10
I had the same issue with "minizlib" not being found. None of the solutions posted on here or other threads regarding this issue solved it.
But, I figured it out. And here is what worked for me. Its pretty straight forward.
All the modules necessary for Expo to run should be located at
/usr/local/lib/node_modules/expo-cli/node_modules/
So, go to your home directory and run npm install minizlib#2.1.0.
This will put the module file in the home directory. (I say home
directory so that the npm install doesnt clutter files into whichever
directory you were previously working on)
Now, you need to copy+paste the module folder to whichever folder npm
is looking for while running the expo command. In your case its
/usr/local/lib/node_modules/expo-cli/node_modules/
This solved the problem for me. If it worked for anyone else, please validate it for me.
install the library
npm install -g minizlib
I had the same issue and I found the way to solve it in an external forum. thanks to #parkerroanm answer there.
Anyway, here is how I solved it (from the answer I found):
I uninstalled expo-cli with this command: sudo npm uninstall -g expo-cli This is did not actually uninstall expo and nothing I could do would. So i deleted the folder with this command: sudo rm -r /usr/local/lib/node_modules/expo-cli
Then reinstalled using yarn instead with: yarn global add expo-cli --save
I updated the PATH in .bashrc to include export PATH="$(yarn global bin):$PATH" to the bottom of the file.
This fixed the issue for me.
It seems to all stem from a permissions error on installation for the
sharp library.
I have downloaded an angular project from angular.io tutorial when i run this project
it shows error
Could not find module "#angular-devkit/build-angular" from "C:\Users\asus\angulario".
Error: Could not find module "#angular-devkit/build-angular" from "C:\Users\asus\angulario"
Could not find module "#angular-devkit/build-angular" from "C:\\Users\\asus\\angulario".
Error: Could not find module "#angular-devkit/build-angular" from "C:\\Users\\asus\\angulario".
at Object.resolve (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\core\node\resolve.js:141:11)
at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\architect\src\architect.js:132:40)
at Observable._trySubscribe (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:30:22)
at C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:99:19
at new Promise (<anonymous>)
at Observable.toPromise (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:97:16)
at ServeCommand.initialize (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\models\architect-command.js:88:94)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
project live example https://stackblitz.com/angular/bvypgkmlmdv
Download link https://angular.io/generated/zips/toh-pt3/toh-pt3.zip
You haven't installed the node modules.
Kindly run the following command npm install and run the application.
You need to install the node modules first.
For that you need to run npm i in the root folder of your downloaded app
(and you need also to have npm installed)
First install NodeJS to your computer, then install npm package manager using global key,
npm i npm -g
And afer that you can install npm packages depending your package.json file as answered previous message.
npm i
After setting new windows in my laptop,i am trying to install npm in command prompt.But i am facing an error which picture is given in below.Would anybody help me out?
If you don't specify a package to install (like npm install -g nodemon) npm will try to install all packages from the current package.json file. If there is non, npm will throw this error.
Npm is already installed. That is why the error message is not Command not found.
The specific command you issued npm install -g attempts to use npm to install the package in the current directory globally.
Leaving the point that installing packages globally is a bad idea aside, this is failing because you are running the command in a directory that does not contain a package. It is your home directory, not one containing a package.json file.
If you are trying to install npm(node package manager) do it by downloading it from here: https://www.npmjs.com/get-npm, then you are good to go.
The command you are actually giving is to install a package using npm(check https://docs.npmjs.com/cli/install).
Thats why the error shows could not install from "" as you have not specified any package to install.
Today is my first day of my first job and after setting up my development environment by updating node and npm on my Mac (OSX) I seem to have broken something. Every time I try to use npm in my commandline (npm init, npm install, etc.) I get this error message:
module.js:339
throw err;
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:20:13
at Object. (/usr/local/lib/node_modules/npm/bin/npm->cli.js:76:3)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
There isn't much of an error message to go off and the stack trace isn't helping me all that much either. Here's what I have tried:
Searched around Stackoverflow and though there are similar problems, people have been able to use npm <something> to solve their problem, which I cannot do.
Uninstalling and reinstalling npm - Didn't work because I can't use npm command at all so things like sudo npm uninstall npm -g don't work.
Removed npmlog directory from .npm directory and then cloned the github repo directly to the directory again.
Hopefully one of you have run into this before or have an idea of how to approach it. Any help is appreciated.
Here is one good link Fixing npm On Mac OS X for Homebrew Users.
with following commands when try to upgrade node.js under mac
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sudo sh
Here are the steps that worked for me:
$ sudo rm -rf /usr/local/bin/npm
$ sudo rm -rf /usr/local/lib/node_modules/npm
$ brew uninstall node
$ brew install node
Try curl -0 -L http://npmjs.org/install.sh | sudo sh to follow redirects. Also notice I added sudo before the sudo sh command depending on your users permissions.
I've just encountered this issue on a Mac, and on closer inspection it seems to me that the problem is that inside the Node application directory in certain circumstances the link in the node/bin directory to npm in lib/node_modules/npm/bin is replaced by the file itself and that is why it fails (and why all the various script methods fix it, because they correctly retain the file link).
If I copy the contents from node-v6.9.4-darwin-x64 with cp then I get this problem, but if I copy the files using the Finder, then I don't. So, you can fix it by manually recreating the link with ln if you don't want to use the Finder (alternatively, mv or rsync -a could work too; I haven't tested them).
Hope this helps someone coming here for this problem.
Edit: I've just accidentally found the reason for the problem on Macs (for my particular scenario, at any rate): I've always used cp -r to copy directories. This is because I am old, and don't learn new things any more. The correct way is cp -R, which correctly copies everything, as it should.
I didn't necessarily "fix" the problem as much as just start over. I used this post to do so: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
If anyone else knows how to actually fix the problem or knows what I did to cause it I would still be very interested.
in my condition, I just
brew uninstall node
and download from the official site and worked for me
I hit this on Fedora 27 after I ran sudo npm install npm -g.
The problem was that I had initially installed Node.js via sudo dnf install nodejs which installs npm into /usr/local/bin and /usr/local/lib. However running sudo npm install installs a separate version in /usr/bin/
Running which npm shows up that the extra npm is installed. Then the following cleaned everything for me:
$ sudo rm /usr/bin/npm
$ sudo rm -rf /usr/lib/node_modules/npm
$ dnf remove -y nodejs
$ dnf install -y nodejs
I encountered this same error. This was on a server not connected to the internet. I had seen a thread on Github that mentioned sometimes symbolic links can be removed while performing copies or other file operations. So I did a "find" on the node directory for symbolic links of the problematic server and none where found. Doing the same on a working server found symbolic link files.
I went to NODE_HOME/bin and did an ls -l
Sure enough I had a file for npm. Performed the same steps on a working server and the npm file was a symbolic link. To fix the problematic server, I performed the following:
rm npm
ln -s ../lib/node_modules/npm/bin/npm-cli.js npm
Got the same error while installing protractor in REDHAT linux updated the
npm
file at
/node-v6.10.2-linux-x64/bin/npm
for the module path as below:
Code Before
var log = require('npmlog')
Code After
var log = require('/node-v6.10.2-linux-x64/lib/node_modules/npm/node_modules/npmlog')
For me, I ran brew uninstall node and then download the latest version from nodejs.org and it worked.
I used the following commands to install a mean stack and create an app:
> sudo npm install -g meanio#latest // Get the mean cmdline
> mean init myApp // create your first app
> cd myApp && npm install // Install dependencies
> grunt // Launch mean
but when I get to the final grunt command I get the error:
module.js:333
throw err;
^ Error: Cannot find module 'coffee-script'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/eddie/ResFour/node_modules/grunt/lib/grunt.js:16:1)
I've tried various solutions on stackoverflow to no avail:
NodeJS - setting up mean.io cannot find module errors
Cannot find module 'coffee-script'
I also cleared npm cache and reinstalled a few times.
Remove node_modules directory.
npm cache clean to empty downloaded temporary dependencies, just in case.
npm install again, and better not to interrupt it while running.
These solved most of these problems for me.
This worked for me:
npm install --save-dev coffee-script
node -v # v0.10.31
I had the same problem, and in the end of the log I was receiving such a message:
...
http 200 http://registry.npmjs.org/-/all
Killed
The problem was the lack of enough memory in my VM. One solution was to use swap is mentioned here.