簡體   English   中英

本地軟件包npm錯誤

[英]local package npm error

我將此依賴項添加到我的package.json中:

"user": "file:./server/models/user"

在我的用戶文件中,我有module.exports = function() {...}

npm ERR! addLocal Could not install /home/WebstormProjects/project/server/models/user
npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! path /home/WebstormProjects/project/server/models/user
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/home/WebstormProjects/project/server/models/user'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/WebstormProjects/project/npm-debug.log

我確實遵循了文檔: https : //docs.npmjs.com/files/package.json#local-paths

錯誤消息不是很有幫助,但必須是(強調我的):

包含軟件包的本地目錄的路徑

https://docs.npmjs.com/files/package.json#local-paths

您似乎正在將其指向文件。 您可能需要類似:

"user": "file:./server/models"

軟件包還需要package.json ,因此在這種情況下,您需要具有server/models/package.json

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM