0

I have created a fresh app with CRA and want to add Sass support according to its official description which simply says to add it with yarn add node-sass

but this throws an error

error /home/.../frontend/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments: 
Directory: /home/.../frontend/node_modules/node-sass
Output:
module.js:550
    throw err;
    ^

Error: Cannot find module 'delegates'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/amir/WORKSPACE/daypay/daypay_v2/frontend/node_modules/are-we-there-yet/tracker-stream.js:4:16)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
4

1 回答 1

0

我不知道为什么,但它似乎node_modules在哪里搞砸了,虽然它是一个新创建的应用程序。

node-sass所以我对and@types/node-sass进行了硬编码,package.json删除了yarn.lockor ( package-lock) 和node_modules文件夹并yarn install再次运行

于 2019-03-05T19:06:20.237 回答