sh: 1: cross-env: Permission denied on laravel mix

后端 未结 5 1947
难免孤独
难免孤独 2021-02-12 13:46

I\'m trying to run npm run dev but the following error occur:

sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ER         


        
相关标签:
5条回答
  • 2021-02-12 14:19

    Try this.

    $ rm -rf node_modules
    
    $ npm cache clear --force
    
    $ npm install npm@latest -g
    
    $ chown -R $USER ~/.npm
    
    $ npm install 
    
    0 讨论(0)
  • 2021-02-12 14:19

    I remove the Nodejs and install the latest version of Nodejs

    0 讨论(0)
  • 2021-02-12 14:22

    This is because of permission issues with global installation of packages, which npm is being denied access.

    To solve this try

    1.

    npm rebuild
    
    npm run watch
    

    Or 2

    rm -Rf node_modules
    
    npm install
    
    npm run watch
    

    Hope it works.

    0 讨论(0)
  • 2021-02-12 14:26

    I was on ubuntu 18.

    Following command helped me :-)

    npm rebuild
    
    0 讨论(0)
  • 2021-02-12 14:41

    Ok I figure out the problem, the storage where the project is saved is auto-mounted and it have no execution permission.

    easily in /etc/fstab file i added exec in the mount option, like this:

    auto,user,exec,utf8,uid=1000,gid=1000,rw 0 0
    
    0 讨论(0)
提交回复
热议问题