gpt4 book ai didi

Node.js - NPM 包在本地发布并为 Node.js 应用程序安装本地发布的 NPM 包

转载 作者:搜寻专家 更新时间:2023-10-31 22:59:38 26 4
gpt4 key购买 nike

我创建了一个本地 NPM 包,我正在尝试使用休闲命令“npm install ../replacevalue/replacevalue-0.1.1tgz”安装本地包。

这给我带来了休闲错误。我的议程是“在本地测试我的 npm 模块而不将它们发布到 npmjs.org”。

0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '../replacevalue/replacevalue-0.1.1tgz' ]
2 info using npm@1.3.14
3 info using node@v0.10.22
4 verbose node symlink D:\Program Files\nodejs\\node.exe
5 verbose readDependencies using package.json deps
6 verbose cache add [ '../replacevalue/replacevalue-0.1.1tgz', null ]
7 verbose cache add name=undefined spec="../replacevalue/replacevalue-0.1.1tgz" args=["../replacevalue/replacevalue-0.1.1tgz",null]
8 verbose parsed url { protocol: null,
8 verbose parsed url slashes: null,
8 verbose parsed url auth: null,
8 verbose parsed url host: null,
8 verbose parsed url port: null,
8 verbose parsed url hostname: null,
8 verbose parsed url hash: null,
8 verbose parsed url search: null,
8 verbose parsed url query: null,
8 verbose parsed url pathname: '../replacevalue/replacevalue-0.1.1tgz',
8 verbose parsed url path: '../replacevalue/replacevalue-0.1.1tgz',
8 verbose parsed url href: '../replacevalue/replacevalue-0.1.1tgz' }
9 silly lockFile 11fd2abd-placevalue-replacevalue-0-1-1tgz ../replacevalue/replacevalue-0.1.1tgz
10 verbose lock ../replacevalue/replacevalue-0.1.1tgz C:\Users\mgowd1\AppData\Roaming\npm-cache\11fd2abd-placevalue-replacevalue-0-1-1tgz.lock
11 silly lockFile 11fd2abd-placevalue-replacevalue-0-1-1tgz ../replacevalue/replacevalue-0.1.1tgz
12 silly lockFile 11fd2abd-placevalue-replacevalue-0-1-1tgz ../replacevalue/replacevalue-0.1.1tgz
13 error addLocal Could not install ../replacevalue/replacevalue-0.1.1tgz
14 error Error: ENOENT, stat 'C:\node\replacevalue\replacevalue-0.1.1tgz'
15 error If you need help, you may report this log at:
15 error <http://github.com/isaacs/npm/issues>
15 error or email it to:
15 error <npm-@googlegroups.com>
16 error System Windows_NT 6.1.7601
17 error command "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "../replacevalue/replacevalue-0.1.1tgz"
18 error cwd C:\node\Node_Odin
19 error node -v v0.10.22
20 error npm -v 1.3.14
21 error path C:\node\replacevalue\replacevalue-0.1.1tgz
22 error code ENOENT
23 error errno 34
24 verbose exit [ 34, true ]

最佳答案

您想使用 npm link

npm link 允许您在文件系统上“安装”一个目录,就好像它是一个包一样。它会创建一个符号链接(symbolic link),这意味着您只需运行一次它就可以使包始终保持“最新”。

要使用它,请导航到您要在其中使用新包的项目,然后运行 ​​npm link/some/directory/path/to/your/package

关于Node.js - NPM 包在本地发布并为 Node.js 应用程序安装本地发布的 NPM 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21248884/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com