I am trying to test sensors using html and javascript like it's shown here but when I try to install polymer as it's written in the readme I get this error:
kupu#kupu:~/Dropbox/IOT/generic-sensor-demos/sensor-info$ npm install -g polymer-cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kupu/.npm/_logs/2020-05-09T17_52_32_877Z-debug.log
And even if I try to run it as sudo I get this:
kupu#kupu:~/Dropbox/IOT/generic-sensor-demos/sensor-info$ sudo npm install -g polymer-cli
/usr/local/bin/polymer -> /usr/local/lib/node_modules/polymer-cli/bin/polymer.js
> wd#1.11.2 install /usr/local/lib/node_modules/polymer-cli/node_modules/wd
> node scripts/build-browser-scripts
/usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:90
throw err0;
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build'
at Object.mkdirSync (fs.js:753:3)
at sync (/usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:71:13)
at Object.<anonymous> (/usr/local/lib/node_modules/polymer-cli/node_modules/wd/scripts/build-browser-scripts.js:6:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/polymer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wd#1.11.2 install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wd#1.11.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-09T17_53_02_303Z-debug.log
Is there a good soul out there that can help me?
You're having a typical npm EACCES permission issue. It has to do with your user not having permissions to modify the directory where npm is trying to store global packages. It can be very annoying. You should look here and see which solution fits you best: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
You can fix it with,
sudo npm install --unsafe-perm -g polymer-cli
Unsafe-perm flag is set to true to suppress User Identifier/ Group Identifier switching when running package scripts.The flag is explicitly set to false to prevent non-root user from installing packages.
You can also try to change ownership of node_modules,
To change ownership to current user as group -
sudo chown -R root: <YOUR_USERNAME>/usr/local/lib/node_modules/
sudo chmod -R 775 /usr/local/lib/node_modules/
And never use sudo for npm related query.
Related
This error I have got.
I am already install node js and npm in my system.
I also have remove npm cache.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2020-11-03T18_21_04_293Z-debug.log
~~~
Don't use sudo for this problem. Use sudo the way it is intended to be used in Ubuntu: for each command that requires it, no more. Don't use sudo to run a command unless it needs to be root. For example, most users would only need sudo for installing things.
Have you try, manually change npm's default directory?
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
To test your new configuration, install a package globally without using sudo:
npm install -g #angular/cli
I tried to update to the latest version of npm and got this error? Anyone ever have a permission error with npm before? I'm stuck as to how to fix it.
marshalls-MacBook-Air:Desktop marshall$ npm install npm#latest -g
npm WARN checkPermissions Missing write access to /usr/local/Cellar/node/11.9.0/lib/node_modules
npm ERR! path /usr/local/Cellar/node/11.9.0/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/Cellar/node/11.9.0/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/Cellar/node/11.9.0/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/Cellar/node/11.9.0/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/Cellar/node/11.9.0/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marshall/.npm/_logs/2019-09-24T17_21_36_708Z-debug.log
you need permission :
sudo npm install npm#latest -g
then put your password
This question already has answers here:
How to fix npm throwing error without sudo
(39 answers)
Closed 3 years ago.
nodemon package does not successfully install using nodejs. I used npm install -g nodmon. I received the permissions-related error below.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/nodemon/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! path ../lib/node_modules/nodemon/bin/nodemon.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR! { [Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR! dest: '/usr/bin/nodemon' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, symlink \'../lib/node_modules/nodemon/bin/nodemon.js\' -> \'/usr/bin/nodemon\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR! dest: '/usr/bin/nodemon' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/etech7/.npm/_logs/2019-07-02T11_31_52_856Z-debug.log
Try to install it with sudo. It it because you need admin permissions.
sudo npm install -g nodemon
Hope it helps!
This is a permissions issue, as indicated by the error message. You need to fix your permissions or use sudo. Please see: npm throws error without sudo
pi#raspberrypi:~ $ npm install -g npm
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/npm'
npm ERR! { [Error: EACCES: permission denied, access '/usr/lib/node_modules/npm']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/lib/node_modules/npm\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules/npm' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-01-13T02_13_34_227Z-debug.log
pi#raspberrypi:~ $
sudo npm install -g npm
Sudo is the key here. May the force be with you.
When i run my first react app using npm start command some error is displayed. Please some one help me to resolve this issue.
C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-server\bin\webpack-dev-server.js:386
throw e;
^
Error: `output.path` needs to be an absolute path or `/`.
at Object.setFs (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-middleware\lib\Shared.js:88:11)
at Shared (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-middleware\lib\Shared.js:214:8)
at module.exports (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-middleware\middleware.js:22:15)
at new Server (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-server\lib\Server.js:56:20)
at startDevServer (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-server\bin\webpack-dev-server.js:379:12)
at processOptions (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-server\bin\webpack-dev-server.js:317:3)
at Object.<anonymous> (C:\Users\ankit\Desktop\r3\node_modules\webpack-dev-server\bin\webpack-dev-server.js:441:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! r3#1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the r3#1.0.0 start script 'webpack-dev-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the r3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs r3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls r3
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\ankit\Desktop\r3\npm-debug.log
The error message is clear: output.path needs to be an absolute path or /
Your output.path should write like this:
var path = require('path');
output: {
path: path.join( __dirname, './dist/'),
}