我有一些符号链接的文件夹node_modules
,以便能够将import
它们作为模块.例如,我有src/client/apps/admin
符号链接到的目录node_modules/@admin
.但是当我尝试安装或删除任何模块时,npm给了我这些警告
$ npm i -S connect-roles ... npm WARN ENOENT ENOENT: no such file or directory, open '/Users/Admin/Code/www/learn/src/client/apps/admin/assets/package.json' npm WARN ENOENT ENOENT: no such file or directory, open '/Users/Admin/Code/www/learn/src/client/apps/admin/components/package.json' npm WARN ENOENT ENOENT: no such file or directory, open '/Users/Admin/Code/www/learn/src/client/apps/admin/reducers/package.json' npm WARN ENOENT ENOENT: no such file or directory, open '/Users/Admin/Code/www/learn/src/client/apps/admin/package.json'
当然,我可以添加package.json
到每个这样的文件夹,但我不想.必须有另一种更好的方法来做到这一点.在那儿?
PS:npm v3.5.3