注意:我对js世界一无所知,所以什么也不做。
我正在尝试开始一个基础教程。我安装了npm和browserify,然后我用
安装了uniq包npm install -g uniq
当我尝试创建browserify包时,我收到此消息:
Error: Cannot find module 'uniq' from '/Users/.../static/js'
at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
如果我在安装uniq时删除了-g,它可以工作,但我无法理解为什么它在使用全局目录时无效。我还在/ usr / local / lib下检查了一个包含uniq目录的node_modules目录。