1 $ npm install --save-dev babel-plugin-syntax-dynamic-import 2 npm WARN checkPermissions Missing write access to D:\sword\react1\r1\node_modules\fsevents 3 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): 4 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 5 6 npm ERR! path D:\sword\react1\r1\node_modules\fsevents 7 npm ERR! code ENOENT 8 npm ERR! errno -4058 9 npm ERR! syscall access 10 npm ERR! enoent ENOENT: no such file or directory, access 'D:\sword\react1\r1\node_modules\fsevents' 11 npm ERR! enoent This is related to npm not being able to find a file. 12 npm ERR! enoent 13 14 npm ERR! A complete log of this run can be found in: 15 npm ERR! F:\nodejs\node_cache\_logs\2017-10-30T04_43_57_804Z-debug.log
今天嘗試打包react項目的時候 ,因爲router4打包比較麻煩。在文檔前端
中提到使用babel-plugin-syntax-dynamic-import
and react-loadable
react
可是在加載import插件的時候,報錯syscall access ,github一查,發現是個偶爾出現但尚沒有好的解決方案。。網友們要麼回退版本要麼用yarn。。。git
我也是醉了github
錯誤的大意是找不到module中的fsevents文件,但這就奇怪了,這個包的頁面上並未提到有什麼依賴關係,也不多是個人node中文件丟失npm
後來發現改用cnpm加載就沒問題...babel
前端有時候就是會遇到這類weird的問題。。。react-router