NativeScript / NativeScript/nativescript-cli

NPM not working under any circumstances

Open
#5,340 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Hello,

I am trying to run NPM on my Mac but it is having the same issue. I have followed all the steps to try and fix this, but when I install after un-insttalling, I get 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! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
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.

And I cannot run the npm to local host. When I try using npm run, I get this;

npm run
Lifecycle scripts included in react-redux-router:
preinstall
npm set audit false
start
webpack-dev-server --config webpack/dev.config.js --watch

available via npm run-script:
build
cross-env NODE_ENV=production webpack --config webpack/prod.config.js --progress --display-error-details --color
heroku-postbuild
npm run build
precommit
eslint src
prod
NODE_ENV=production node server.js

I tried to run delete node_modules but it said I did not recognize the command. Both NPM and Node are updated to their lastest updated versions, npm at 6.14.5 and node at v14.5.0. My mac is running Catalina 10.15.5. Any idea why this is happening or how I can fix it?
Describe the bug

To Reproduce

I just go into my npm and try to start it or run it and I get the output above.
Expected behavior
for it to run my project on localhost:3000 so I can see my work
Sample project

Additional context
Please let me know if you have any questions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names npm 6.14.5, Node v14.5.0, macOS Catalina, and a React project using webpack/dev.config.js. Start by reproducing the /usr/local/lib/node_modules EACCES error and the npm run failure, then determine whether the problem belongs to NativeScript CLI or local npm permissions. Done requires a confirmed project-specific reproduction and a verified localhost start path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.