Code Monkey home page Code Monkey logo

koa-trailer's Introduction

Reaper622

My name is MacTavish Lee aka Reaper622, chinese name is Bowen Li.

  • I'm a Web FrontEnd Developer working in ByteDance Central Platform Arch-FE Team.
  • I'm currently learning machine learning / TensorFlow.js / Rust.
  • A Game | Photograph | Code lover.
  • 📫 How to reach me: [email protected] | [email protected]

Top Langs

Visitor count

koa-trailer's People

Contributors

reaper622 avatar

Watchers

 avatar

koa-trailer's Issues

'NODE_ENV' 不是内部或外部命令,也不是可运行的程序

在package.json中写入运行脚本
···
“scripts”:{
"start": "rimraf dist && rimraf .cache && NODE_ENV=development nodemon ./start.js",
}
···

在执行的时候报出 'NODE_ENV' 不是内部或外部命令,也不是可运行的程序

问题的原因是Windows 的 cmd 环境 与 linux 的shell 和 bash 环境的不同,语法会存在差异。
在 Windows环境中设置为

“scripts”:{
"start": "rimraf dist && rimraf .cache && set NODE_ENV=development &&  nodemon ./start.js",
}

puppeteer 安装国内无法获得Chromium内核

在直接使用 npm 安装 puppeteer 的时候我们会因为一个和谐国内被墙的原因无法下载到puppeteer 默认附带的 Chromium内核,具体报错如下:

ERROR: Failed to download Chromium r515411! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOA
D" env variable to skip download.

这里我们有多种解决方法

使用淘宝提供的Chromium源

npm config set puppeteer_download_host=https://npm.taobao.org/mirrors
npm i puppeteer

如果安装有cnpm也可以直接使用cnpm安装

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm i puppeteer

手动下载所需要的Chromium内核

此时我们需要先安装puppeteer,我们可以执行不附带安装Chromium的其他的内容

npm i --save puppeteer --ignore-scripts

接着我们通过查看 puppeteer/package.json->puppeteer.chromium_revision 来得知所对应的Chromium版本,然后在https://npm.taobao.org/mirrors/chromium-browser-snapshots/找到对应版本

此时有两种方法让puppeteer读取到Chromium

更多参考

puppeteer官方API文档

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.