安装node-sass的时候报错
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-83_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
方法一》在命令行中执行,然后在安装node-sass什么的,一劳永逸。
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass
方法二:一个方法就够了,。,(╯‵□′)╯︵┻━┻
- nrm 在高版本node中报错的问题。
找到nrm的安装位置,找到cli.js 大概在17.18行的位置
//const NRMRC = path.join(process.env.HOME, '.nrmrc'); 修改为下面的即可
const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');
node-sass 被废弃了,不再添加新功能(进入维护阶段),现在推荐使用的是 dart-sass ,要是切换的话注意下,还是有点区别的 ,好像是/deep/有些区别,dart-sass只支持:v-deep这中写法。---- 相关文档
package.json 中的版本控制
指定版本:比如 1.2.2 ,遵循“大版本.次要版本.小版本”的格式规定,安装时只安装指定版本。
波浪号(tilde)+指定版本:比如 ~1.2.2 ,表示安装 1.2.x 的最新版本(不低于1.2.2),但是不安装 1.3.x,也就是说安装时不改变大版本号和次要版本号。
插入号(caret)+指定版本:比如 ˆ1.2.2,表示安装 1.x.x 的最新版本(不低于 1.2.2),但是不安装 2.x.x,也就是说安装时不改变大版本号。需要注意的是,如果大版本号为 0,则插入号的行为与波浪号相同,这是因为此时处于开发阶段,即使是次要版本号变动,也可能带来程序的不兼容。
latest:安装最新版本。
npm list xxx
可以用来查看该软件包实际安装的版本
Tips:
npm run [script]
If no “command” is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well,
也就是说 test, start, restart, and stop这几个命令可以不用加run既可以执行