1.清除缓存
javascript
npm cache clean --force
2.配置发布仓库
javascript
{
"name":"core",
"version":"1.0.0",
"description":"core package",
"main":"index.js",
"scripts":{
"test":"echo \"Error: no test specified\" && exit 1",
"build":"webpack --mode production",
"publish":"npm publish"
},
"author":"",
"license":"ISC",
"publishConfig":{
"registry":"http://127.0.0.1/nexus/content"
},
"devDependencies":{
"css-loader":"^6.11.0",
"eslint":"^8.57.0",
"expose-loader":"^4.1.0",
"mini-css-extract-plugin":"^2.9.0",
"mocker-api":"^2.8.3",
"sass":"^1.77.8",
"sass-loader":"^13.3.3",
"style-loader":"^3.3.4",
"ts-loader":"^9.5.1",
"typescript":"^4.9.5",
"webpack":"^5.93.0",
"webpack-cli":"^4.5.0",
"webpack-dev-server":"^3.11.2"
},
"dependencies":{
"loadsh":"^4.17.21"
}
}
3.发布
javascript
npm --script publish