美文网首页
npm js管理器使用问题

npm js管理器使用问题

作者: Eric_coco | 来源:发表于2020-07-03 19:23 被阅读0次

    Mac

    1、Resolving EACCES permissions errors when installing packages globally

    1)Back up your computer.

    2)On the command line, in your home directory, create a directory for global installations:

    mkdir ~/.npm-global

    3)Configure npm to use the new directory path:

    npm config set prefix '~/.npm-global'

    4)In your preferred text editor, open or create a ~/.profile file and add this line:

    export PATH=~/.npm-global/bin:$PATH

    5)On the command line, update your system variables:

    source ~/.profile

    6)To test your new configuration, install a package globally without using sudo:

    npm install -g jshint

    2、npm install出现”Unexpected end of JSON input while parsing near”的错误

    运行  npm cache clean --force

    3、Module build failed: Error: Cannot find module 'node-sass’解决

             npm install node-sass --save-dev

    4、vue中lang="scss"

    npm install sass-loader@7.3.1 --save-dev// 注意版本号,否则会因为版本号过高而报错

    npm install --save-dev node-sass

    相关文章

      网友评论

          本文标题:npm js管理器使用问题

          本文链接:https://www.haomeiwen.com/subject/pakeqktx.html