2
我嘗試在Symfony中使用Encore。第一個示例Encore - 路徑必須是字符串。收到undefined
我運行命令:
./node_modules/.bin/encore dev
,這回我的錯誤:
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at find (/www/testencore/node_modules/babel-loader/lib/resolve-rc.js:11:21)
at module.exports (/www/testencore/node_modules/@symfony/webpack-encore/lib/config/parse-runtime.js:64:47)
at Object.<anonymous> (/www/testencore/node_modules/@symfony/webpack-encore/bin/encore.js:18:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
請注意,有一個命令'yarn upgrade',而不是刪除鎖定文件並重新構建它。 – user254319
確實更乾淨,更新了答案,謝謝:) –