nodejs打包問題解決例項

不懂123發表於2024-03-16

node命令集合

npm set registry https://registry.npm.taobao.org/

npm config set registry https://registry.npmjs.org/

npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/

npm get registry

//npm安裝包的提示操作目錄許可權不足

npm config set unsafe-perm=true

npm config set python /usr/bin/python2

npm install

npm install cnpm

npm install --unsafe-perm node-sass

//清空快取檔案

npm cache clean --force

//跳過自簽名證書驗證

NODE_TLS_REJECT_UNAUTHORIZED=0 cnpm install

DEBUG=* cnpm run build:prod

nvm ls

nvm install v16.15.1

nvm use v16.15.1

nvm alias default v16.15.1

npm config set unsafe-perm=true

npm install

npm run build:prod

node-sass安裝

npm config set python /usr/bin/python2

npm install --unsafe-perm node-sass

靜默強制覆蓋 不需要輸入y確認

\cp -f -r * /var/lib/jenkins/workspace/test-55-h5/node_modules/

解決示例

相關文章