【发布时间】:2019-05-04 19:29:49
【问题描述】:
我正在尝试运行一个应用程序(我将继续工作),使用:
yarn start
但我得到了错误:
ts-node ./src/engine/server/server
Error: Cannot find module 'contextify'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/aa/Documents/app/node_modules/jsdom/lib/jsdom/browser/index.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
依赖contextify 不在package.json 中。我尝试了不同的节点版本,但我得到了相同的结果。该应用程序使用 Webpack 在 TypeScript 中。我用的是 Mac。有什么想法吗?
【问题讨论】:
-
你在使用 npm install 的时候有什么错误吗?
-
@JFPicard 当我运行
npm install时出现错误gyp ERR! stack Error: 'gyp' failed with exit code: 1之后,如果我运行yarn start我会收到另一个错误err = new Error('Could not locate the bindings file. Tried:\n'但是当我使用yarn install安装时我得到了上述错误。所有者已经使用yarn运行应用程序,所以问题出在我的机器(Mac)上。
标签: typescript webpack yarnpkg