Npm install not working


  • | 2134 points

    I'm new to coding and I'm following Laracasts "Laravel 5.4 from scratch". He's introducing us to mix. I'm getting an error when it comes to npm install and cross-env is not recognized as a internal or external function. Is my problem with windows 10 or laragon?

    The error I get when I type "npm install" in the laragon command

      C:\laragon\www\blog
      +-- axios@0.16.2
      | `-- follow-redirects@1.2.4
      |   `-- debug@2.6.8
      |     `-- ms@2.0.0
     +-- babel-core@6.26.0  extraneous
     +-- bootstrap-sass@3.3.7
     +-- cross-env@5.0.5
     | `-- cross-spawn@5.1.0
     |   +-- lru-cache@4.1.1
     |   | +-- pseudomap@1.0.2
     |   | `-- yallist@2.1.2
     |   +-- shebang-command@1.2.0
     |   | `-- shebang-regex@1.0.0
     |   `-- which@1.3.0
     +-- jquery@3.2.1
     +-- lodash@4.17.4
     `-- vue@2.4.4
    
     npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
     (node_modules\chokidar\node_modules\fsevents):
     npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
     fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\adjust-sourcemap-loader\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\babel-code-frame\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\bin-build\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\buffer-to-vinyl\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\bin-version-check\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
    'C:\laragon\www\blog\node_modules\caniuse-api\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\caw\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\center-align\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\cosmiconfig\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\clap\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\clone-deep\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\css\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\cssnano\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\decompress-tar\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\css-loader\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\decompress-tarbz2\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\decompress-targz\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\default-gateway\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\del\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\exec-buffer\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\express\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\fancy-log\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\friendly-errors-webpack-plugin\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\glob-stream\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\gulp-util\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\http-proxy-middleware\package.json'
      npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\internal-ip\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\css-loader\node_modules\chalk\package.json'
     npm WARN enoent ENOENT: no such file or directory, open 
     'C:\laragon\www\blog\node_modules\cssnano\node_modules\chalk\package.json'
    
     npm ERR! Windows_NT 10.0.14393
     npm ERR! argv "C:\\laragon\\bin\\nodejs\\node-v6.11.0-x64\\node.exe" 
     "C:\\laragon\\bin\\nodejs\\node-v6.11.0-x64\\node_modules\\npm\\bin\\npm-cli.js" "install"
     npm ERR! node v6.11.0
     npm ERR! npm  v3.10.10
     npm ERR! path C:\laragon\www\blog\node_modules\.staging\ajv-7d583b18
     npm ERR! code EPERM
     npm ERR! errno -4048
     npm ERR! syscall rename
    
    npm ERR! Error: EPERM: operation not permitted, rename 
    'C:\laragon\www\blog\node_modules\.staging\ajv-7d583b18' -> 
    'C:\laragon\www\blog\node_modules\har-validator\node_modules\ajv'
    npm ERR!     at destStatted (C:\laragon\bin\nodejs\node-v6.11.0-
    x64\node_modules\npm\lib\install\action\finalize.js:25:7)
    npm ERR!     at C:\laragon\bin\nodejs\node-v6.11.0-
    x64\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:\laragon\www\blog\node_modules\.staging\ajv-7d583b18' -> 
    'C:\laragon\www\blog\node_modules\har-validator\node_modules\ajv'
    npm ERR!     at Error (native)
    npm ERR!  { Error: EPERM: operation not permitted, rename 
    'C:\laragon\www\blog\node_modules\.staging\ajv-7d583b18' -> 
    'C:\laragon\www\blog\node_modules\har-validator\node_modules\ajv'
    npm ERR!     at destStatted (C:\laragon\bin\nodejs\node-v6.11.0-
    x64\node_modules\npm\lib\install\action\finalize.js:25:7)
    npm ERR!     at C:\laragon\bin\nodejs\node-v6.11.0-
    x64\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:\laragon\www\blog\node_modules\.staging\ajv-7d583b18' -> 
    'C:\laragon\www\blog\node_modules\har-validator\node_modules\ajv'
    npm ERR!     at Error (native) parent: 'har-validator' }
    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:\laragon\www\blog\npm-debug.log
    

    My package.json file

     {
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.16.2",
        "bootstrap-sass": "^3.3.7",
        "cross-env": "^5.0.1",
        "jquery": "^3.1.1",
        "laravel-mix": "^1.0",
        "lodash": "^4.17.4",
        "vue": "^2.1.10"
    }}
    

    My webpack.mix.js file

     let mix = require('laravel-mix');
     mix.js('resources/assets/js/app.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css');
    

    Thanks for the help!


  • administrators
    | 68976 points

    @lullidebrosse : Check the log, you can see there are errors about permissions.

    npm ERR! Error: EPERM: operation not permitted, rename 
    'C:\laragon\www\blog\node_modules\.staging\ajv-7d583b18' -> 
    'C:\laragon\www\blog\node_modules\har-validator\node_modules\ajv'
    npm ERR!     at Error (native) parent: 'har-validator' }
    npm ERR!
    npm ERR! Please try running this command again as root/Administrator.
    

    You can try installing Laragon to D: partition and start again.


  • | 2134 points

    @leokhoa

    You can try installing Laragon to D: partition and start again.

    It worked :smiley: . I honestly didn't know that you could do that.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.