[英]Why do i get this npm Error: Cannot find module '/home/directory' from '/home/directory'
I have the following scripts in my package.json file我的 package.json 文件中有以下脚本
"scripts": {
"start": "watchify -o js/bundle.js -v -d ."
}
When i run npm start
inside /home/directory
i get this error Error: Cannot find module '/home/directory' from '/home/directory'
当我在/home/directory
运行npm start
此错误Error: Cannot find module '/home/directory' from '/home/directory'
My directory structure is like我的目录结构就像
-/home/directory
--package.json
-js/
--script1.js
--script2.js
Why am i getting this error?为什么我收到这个错误?
My guess is that you can pass multiple argument to watchify.我的猜测是您可以将多个参数传递给 watchify。 Lets say you remove the flags, you should get something like "watchify js/bundle.js ."
假设您删除了标志,您应该得到类似"watchify js/bundle.js ."
so watchify might be trying to run for both js/bundle.js
and .
所以 watchify 可能试图同时运行js/bundle.js
和.
(the last one pointing to your current dir which is home/directory
) (最后一个指向您当前的目录,即home/directory
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.