在 Homestead 中 执行 yarn add cross-env 报错,无法成功执行,该怎么做?
根据教程,在执行 yarn add cross-nav
的时候会报错。
$ yarn add cross-env --no-bin-install
yarn add v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/home/vagrant/code/homestead.test/node_modules/acorn-dynamic-import/node_modules/.bin/acorn'".
info If you think this is a bug, please open a bug report with the information provided in "/home/vagrant/code/homestead.test/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
我想还是和虚拟机的 symbol-link 有关,所以抱着侥幸心理带上 --no-bin-links
参数尝试了一次……结果如我所料并没有卵用。
求懂的人赐教。
没办法,最后使用了 cnpm 才弄好。
本地安装 npm 和 cnpm。
使用 cnpm install
和 cnpm install cross-env --save
代替教程提供的 yarn install --no-bin-links
和 yarn add cross-env
才成功的。
推荐文章: