核心提示:安装启动web端项目安装cnpmnpm install -g cnpm --registry=https://registry.npm.taobao.org或者设置下载仓库为淘宝镜像npm config set registry http://registry.npm.taobao.org/eg:C:\\Users\\x1c>npm config set registry http://registry.npm.taobao.org/C:\\Users\\x1c>npm configpython
安装启动web端项目
安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
或者设置下载仓库为淘宝镜像
npm config set registry http://registry.npm.taobao.org/
eg:
C:\Users\x1c>npm config set registry http://registry.npm.taobao.org/
C:\Users\x1c>npm config list
; cli configs
metrics-registry = "http://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.5.0 node/v11.9.0 win32 x64"
; userconfig C:\Users\x1c\.npmrc
cache = "D:\\Environments\\nodejs\\node_cache"
disturl = "https://npm.taobao.org/dist"
prefix = "D:\\Environments\\nodejs\\node_global"
python = "C:\\Users\\x1c\\.windows-build-tools\\python27\\python.exe"
registry = "http://registry.npm.taobao.org/"
; node bin location = D:\Environments\nodejs\node.exe
; cwd = C:\Users\x1c
; HOME = C:\Users\x1c
; "npm config ls -l" to show all defaults.
C:\Users\x1c>
安装完出现以下错误 Module build failed: Error: Cannot find module ‘node-sass’
Module build failed: Error: Cannot find module 'node-sass'
错误表示找不到模块node-sass
我的node、npm版本
PS C:\Users\Administrator\Desktop\mall4v> node -v
v10.14.2
PS C:\Users\Administrator\Desktop\mall4v> npm -v
6.4.1
C:\Users\x1c>
错误信息是表示找不到node-sass模块,我重新安装下吧。
解决办法执行
cnpm install node-sass
若安装过程中出现Permission denied错误,则用如下命令安装:
npm install node-sass --unsafe-perm=true --allow-root
或者直接npm
npm install node-sass
我的安装好了
重新 cnpm install 整个项目再运行整个项目吧,可以了
cnpm install
npm run dev
PS C:\Users\Administrator\Desktop\mall4v> npm run dev
> admin-vue@1.0.0 dev C:\Users\Administrator\Desktop\mall4v
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
28% building modules 158/208 modules 50 active ...inistrator\Desktop\mall4v\src\App.vueNo parser and no filepath given, using 'babel' the parser
now but this will throw an error in the future. Please spe 41% building modules 266/309 modules 43 active ...4v\src\views\modules\sys\schedule.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. 42% building modules 270/311 modules 41 active ...odules\sys\schedule-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. 42% building modules 272/313 modules 41 active ...ws\modules\sys\user-add-or-update.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. 43% building modules 275/315 modules 40 active ...mall4v\src\views\modules\sys\role.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. 43% building modules 280/317 modules 37 active ...rc\views\modules\sys\schedule-log.vueNo parser and no filepath given, using 'babel' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred. 43% building modules 282/319