我正在测试 shelljs
模块,该模块旨在使用简单的测试程序在 Chrome 浏览器上运行,但出现以下错误:
can't find module '/.src/cat'
我使用以下命令在 shelljs
中安装了 node_modules
模块,但不知何故 browserify 无法选择它?:
npm install shelljs --save
有人可以帮助确定这个问题吗?
版本信息:
main.js:
"use strict";
var sh = require('shelljs');
const output = sh.echo('hello world!', {silent:true});
console.log(output);
index.html:
<script src="bundle.js"></script>
命令行界面:
browserify --debug main.js -o bundle.js
从 Chrome 检查中得到以下错误:
<块引用>Uncaught Error: Cannot find module './src/cat'