我试图用Rails和Vuejs上的ruby启动我的第一个应用程序。
我使用https://mkdev.me/en/posts/rails-5-vue-js-how-to-stop-worrying-and-love-the-frontend作为教程来学习和创建我的应用程序。
一切都很好,但是当我尝试运行$ foreman start
时,我的cmd会抛出一些错误:
21:48:11 frontend.1 | internal/modules/cjs/loader.js:596
21:48:11 frontend.1 | throw err;
21:48:11 frontend.1 | ^
21:48:11 frontend.1 |
21:48:11 frontend.1 | Error: Cannot find module 'ajv'
21:48:11 frontend.1 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
21:48:11 frontend.1 | at Function.Module._load (internal/modules/cjs/loader.js:520:25)
21:48:11 frontend.1 | at Module.require (internal/modules/cjs/loader.js:650:17)
21:48:11 frontend.1 | at require (internal/modules/cjs/helpers.js:20:18)
21:48:11 frontend.1 | at Object.<anonymous> (C:\Users\Hieu Vo\AppData\Roaming\npm\node_modules\webpack\node_modules\schema-utils\src\validateOptions.js:11:13)
21:48:11 frontend.1 | at Module._compile (internal/modules/cjs/loader.js:702:30)
21:48:11 frontend.1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
21:48:11 frontend.1 | at Module.load (internal/modules/cjs/loader.js:612:32)
21:48:11 frontend.1 | at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
21:48:11 frontend.1 | at Function.Module._load (internal/modules/cjs/loader.js:543:3)
这是我的Procfile:
rails: rails s -p 3000
frontend: webpack-dev-server
希望您能帮助我解决此问题。非常感谢。
答案 0 :(得分:1)
尝试
npm install ajv
然后再次运行