0

After upgrading from laravel 5.6 to 5.7, running npm install or npm update is giving the following error:

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
C:\Users\Raj\Repositories\my-project
+-- ansi-regex@2.1.1  extraneous
+-- axios@0.18.0
| +-- follow-redirects@1.5.8
| | `-- debug@3.1.0
| |   `-- ms@2.0.0
| `-- is-buffer@1.1.6
+-- babel-code-frame@6.26.0  extraneous
+-- babel-core@6.26.3  extraneous
+-- bootstrap@4.1.3
+-- d@1.0.0  extraneous
+-- jquery@3.3.1
+-- lodash@4.17.11
+-- popper.js@1.14.4
`-- vue@2.5.17

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN img-loader@3.0.0 requires a peer of imagemin@^5.0.0 but none was installed.
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none was installed.
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! path C:\Users\Raj\Repositories\my-project\node_modules\.staging\abbrev-954abfcd
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Raj\Repositories\my-project\node_modules\.staging\abbrev-954abfcd' -> 'C:\Users\Raj\Repositories\my-project\node_modules\abbrev'
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Raj\Repositories\my-project\node_modules\.staging\abbrev-954abfcd' -> 'C:\Users\Raj\Repositories\my-project\node_modules\abbrev'
npm ERR!     at Error (native)
npm ERR!  Error: EPERM: operation not permitted, rename 'C:\Users\Raj\Repositories\my-project\node_modules\.staging\abbrev-954abfcd' -> 'C:\Users\Raj\Repositories\my-project\node_modules\abbrev'
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Raj\Repositories\my-project\node_modules\.staging\abbrev-954abfcd' -> 'C:\Users\Raj\Repositories\my-project\node_modules\abbrev'
npm ERR!     at Error (native)
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Raj\Repositories\my-project\npm-debug.log

Also when I check outdated packages with npm outdated I got the following output:

$ npm outdated
Package      Current   Wanted   Latest  Location
axios        MISSING   0.18.0   0.18.0
bootstrap    MISSING    4.1.3    4.1.3
jquery       MISSING    3.3.1    3.3.1
laravel-mix  MISSING   2.1.14   2.1.14
lodash       MISSING  4.17.11  4.17.11
popper.js    MISSING   1.14.4   1.14.4
vue          MISSING   2.5.17   2.5.17

Why is everything missing when my project actually runs properly?

Please provide a way to solve this problem?

Raj
  • 1,928
  • 3
  • 29
  • 53

2 Answers2

0

It is the permission problem

Navigate to the project folder and try running chmod -R 777 if you are using linux

Anku Singh
  • 914
  • 6
  • 12
  • Check this url https://www.wikihow.com/Change-File-Permissions-on-Windows-7 it will help you in changing the permission of any folder in windows – Anku Singh Sep 16 '18 at 06:15
  • I checked I already have all permission. The problem seems to be something else – Raj Sep 16 '18 at 06:18
0

Try removing NPM cached files from AppData -> Roaming -> npm-cache. This worked for me.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
ioniizer
  • 1
  • 1
  • 1