在nodejs目錄下輸入命令npm install -g @vue/cli
報錯如下:
npm err! code elifecycle
npm err! errno 1
npm err! [email protected] postinstall: `node scripts/postinstall`
npm err! exit status 1
npm err!
npm err! failed at the [email protected] postinstall script.
npm err! this is probably not a problem with npm. there is likely additional logging output above.
解決辦法:
npm install @vue/cli -g --ignore-scripts
npm install protobufjs -g --ignore-scripts
再檢視vue --version成功了
參考文章:
檢視vue版本的時候報錯:
internal/modules/cjs/loader.js:783
throw err;
^error: cannot find module 'c:\program files\nodejs\node_modules\@vue\cli\bin\vue.js'
[90m at function.module._resolvefilename (internal/modules/cjs/loader.js:780:15)[39m
[90m at function.module._load (internal/modules/cjs/loader.js:685:27)[39m
[90m at function.module.runmain (internal/modules/cjs/loader.js:1014:10)[39m
[90m at internal/main/run_main_module.js:17:11[39m
解決方法:
是因為vue腳手架沒有全域性安裝。
npm install -g @vue/cli
參考文章:
解除安裝已經安裝的webpack時候出現報錯:
npm err! code eperm
npm err! syscall mkdir
npm err! path c:\program files\nodejs\node_modules\.staging
npm err! errno -4048
npm err! error: eperm: operation not permitted, mkdir 'c:\program files\nodejs\node_modules\.staging'
npm err! [operationalerror: eperm: operation not permitted, mkdir 'c:\program files\nodejs\node_modules\.staging'] ,
npm err! stack: "error: eperm: operation not permitted, mkdir 'c:\\program files\\nodejs\\node_modules\\.staging'",
npm err! errno: -4048,
npm err! code: 'eperm',
npm err! syscall: 'mkdir',
npm err! path: 'c:\\program files\\nodejs\\node_modules\\.staging'
npm err! }
npm err!
npm err! the operation was rejected by your operating system.
npm err! it's possible that the file was already in use (by a text editor or antivirus),
npm err! or that you lack permissions to access it.
npm err!
npm err! if you believe this might be a permissions issue, please double-check the
npm err! permissions of the file and its containing directories, or try running
npm err! the command again as root/administrator.
解決方法:
重點是這裡的:npm err! error: eperm: operation not permitted
其實就是許可權問題,使用管理員許可權應該ok。
選擇"使用管理員許可權執行cmd";然後繼續輸入命令即可。
安裝vue cli3遇到的問題
在nodejs目錄下輸入命令npm install g vue cli 報錯如下 npm err code elifecycle npm err errno 1 npm err protobufjs 6.8.8 postinstall node scripts postinstall npm err...
vue cli3的安裝使用
1 全域性安裝vue cli 使用命令 cnpm install g vue cli npm install g vue cli yarn global add vue cli 注意 nodejs版本應該大於8,否則安裝有問題 2 檢測安裝 使用vue v檢視 1 建立專案 根據自身需求選擇配置,最...
Vue cli3 安裝bootstrap報錯
1 安裝 jquery 2 安裝 popper.js 3 安裝 bootstrap 1.1 報錯資訊 如圖所示 1.2 猜測原因 搜尋了一下報錯,大致有以下幾種情況 1 jquery popper bootstrap bootstrap 依賴於 jquery 和 popper 三者的安裝順序不正確 ...