npm run build 運行報錯處理

最近電腦重裝系統(tǒng)后運行 npm run dev 正常運行,npm run build 打包文件模暗,提示如下錯誤:

Administrator@WIN-9PL8VSAPS0 MINGW64 /h/project_latest

$ npm run build

> demo@ build H:\project_package_version_latest

> cross-env NODE_ENV=production webpack --progress --hide-modules

'webpack' ????????????????????????е????

?????????????

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\? ? ? node_modules\\npm\\bin\\npm-cli.js" "run" "build"

npm ERR! node v6.9.4

npm ERR! npm? v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! demo@ build: `cross-env NODE_ENV=production webpack --progress --hide-m? ? ? odules`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the demo@ build script 'cross-env NODE_ENV=production webpack? ? ? --progress --hide-modules'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the demo package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!? ? cross-env NODE_ENV=production webpack --progress --hide-modules

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!? ? npm bugs demo

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!? ? npm owner ls demo

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR!? ? H:\project_package_version_latest\npm-debug.log

家里的電腦上可以正常運行,考慮是缺少了什么文件,但不知道是哪個文件讹蘑,網(wǎng)上搜索相關(guān)問題,最后看到一個?

'NODE_ENV' ????????????????????????е??????????????????

報錯筑舅,于是回頭看我那個

?'webpack' ????????????????????????е?????????????????

之前一直沒注意到這個座慰,這就是缺少的文件,原來我在項目本地安裝了webpack豁翎,重裝系統(tǒng)后未全局安裝角骤。

先全局安裝webpack隅忿,

$ npm install webpack -g

C:\Users\Administrator\AppData\Roaming\npm\webpack -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js

C:\Users\Administrator\AppData\Roaming\npm

`-- webpack@1.14.0

+-- acorn@3.3.0

+-- async@1.5.2

+-- clone@1.0.2

+-- enhanced-resolve@0.9.1

| +-- graceful-fs@4.1.11

| `-- memory-fs@0.2.0

+-- interpret@0.6.6

+-- loader-utils@0.2.16

| +-- big.js@3.1.3

| +-- emojis-list@2.1.0

| +-- json5@0.5.1

| `-- object-assign@4.1.1

+-- memory-fs@0.3.0

| +-- errno@0.1.4

| | `-- prr@0.0.0

| `-- readable-stream@2.2.2

|? +-- buffer-shims@1.0.0

|? +-- core-util-is@1.0.2

|? +-- inherits@2.0.3

|? +-- isarray@1.0.0

|? +-- process-nextick-args@1.0.7

|? `-- util-deprecate@1.0.2

+-- mkdirp@0.5.1

| `-- minimist@0.0.8

+-- node-libs-browser@0.7.0

| +-- assert@1.4.1

| +-- browserify-zlib@0.1.4

| | `-- pako@0.2.9

| +-- buffer@4.9.1

| | +-- base64-js@1.2.0

| | `-- ieee754@1.1.8

| +-- console-browserify@1.1.0

| | `-- date-now@0.1.4

| +-- constants-browserify@1.0.0

| +-- crypto-browserify@3.3.0

| | +-- browserify-aes@0.4.0

| | +-- pbkdf2-compat@2.0.1

| | +-- ripemd160@0.2.0

| | `-- sha.js@2.2.6

| +-- domain-browser@1.1.7

| +-- events@1.1.1

| +-- https-browserify@0.0.1

| +-- os-browserify@0.2.1

| +-- path-browserify@0.0.0

| +-- process@0.11.9

| +-- punycode@1.4.1

| +-- querystring-es3@0.2.1

| +-- stream-browserify@2.0.1

| +-- stream-http@2.6.3

| | +-- builtin-status-codes@3.0.0

| | +-- to-arraybuffer@1.0.1

| | `-- xtend@4.0.1

| +-- string_decoder@0.10.31

| +-- timers-browserify@2.0.2

| | `-- setimmediate@1.0.5

| +-- tty-browserify@0.0.0

| +-- url@0.11.0

| | +-- punycode@1.3.2

| | `-- querystring@0.2.0

| +-- util@0.10.3

| | `-- inherits@2.0.1

| `-- vm-browserify@0.0.4

|? `-- indexof@0.0.1

+-- optimist@0.6.1

| `-- wordwrap@0.0.3

+-- supports-color@3.2.3

| `-- has-flag@1.0.0

+-- tapable@0.1.10

+-- uglify-js@2.7.5

| +-- async@0.2.10

| +-- source-map@0.5.6

| +-- uglify-to-browserify@1.0.2

| `-- yargs@3.10.0

|? +-- camelcase@1.2.1

|? +-- cliui@2.1.0

|? | +-- center-align@0.1.3

|? | | +-- align-text@0.1.4

|? | | | +-- longest@1.0.1

|? | | | `-- repeat-string@1.6.1

|? | | `-- lazy-cache@1.0.4

|? | +-- right-align@0.1.3

|? | `-- wordwrap@0.0.2

|? +-- decamelize@1.2.0

|? `-- window-size@0.1.0

+-- watchpack@0.2.9

| +-- async@0.9.2

| `-- chokidar@1.6.1

|? +-- anymatch@1.3.0

|? | +-- arrify@1.0.1

|? | `-- micromatch@2.3.11

|? |? +-- arr-diff@2.0.0

|? |? | `-- arr-flatten@1.0.1

|? |? +-- array-unique@0.2.1

|? |? +-- braces@1.8.5

|? |? | +-- expand-range@1.8.2

|? |? | | `-- fill-range@2.2.3

|? |? | |? +-- is-number@2.1.0

|? |? | |? +-- isobject@2.1.0

|? |? | |? `-- randomatic@1.1.6

|? |? | +-- preserve@0.2.0

|? |? | `-- repeat-element@1.1.2

|? |? +-- expand-brackets@0.1.5

|? |? | `-- is-posix-bracket@0.1.1

|? |? +-- extglob@0.3.2

|? |? +-- filename-regex@2.0.0

|? |? +-- kind-of@3.1.0

|? |? | `-- is-buffer@1.1.4

|? |? +-- normalize-path@2.0.1

|? |? +-- object.omit@2.0.1

|? |? | +-- for-own@0.1.4

|? |? | | `-- for-in@0.1.6

|? |? | `-- is-extendable@0.1.1

|? |? +-- parse-glob@3.0.4

|? |? | +-- glob-base@0.3.0

|? |? | `-- is-dotfile@1.0.2

|? |? `-- regex-cache@0.4.3

|? |? ? +-- is-equal-shallow@0.1.3

|? |? ? `-- is-primitive@2.0.0

|? +-- async-each@1.0.1

|? +-- glob-parent@2.0.0

|? +-- is-binary-path@1.0.1

|? | `-- binary-extensions@1.8.0

|? +-- is-glob@2.0.1

|? | `-- is-extglob@1.0.0

|? +-- path-is-absolute@1.0.1

|? `-- readdirp@2.1.0

|? ? +-- minimatch@3.0.3

|? ? | `-- brace-expansion@1.1.6

|? ? |? +-- balanced-match@0.4.2

|? ? |? `-- concat-map@0.0.1

|? ? `-- set-immediate-shim@1.0.1

`-- webpack-core@0.6.9

+-- source-list-map@0.1.8

`-- source-map@0.4.4

`-- amdefine@1.0.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\webpack\node_modules\chokidar\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

webpack安裝成功心剥,開始打包 npm run build

$ npm run build

> demo@ build H:\project_package_version_latest

> cross-env NODE_ENV=production 35% building modules 212/227 modules 15 active ...on_latest\src\assets\page-content.css

正在打包……

$ npm run build

Hash: b4ec0192fe9ac74b479e? ? ? ? ? ? ? ? ? ? ? Version: webpack 2.1.0-beta.10? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Time: 61343ms

打包成功。

網(wǎng)上看到一些類似的問題背桐,基本都是

'webpack' ????????????????????????е?????????????????

提示信息所指向的問題优烧。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市链峭,隨后出現(xiàn)的幾起案子畦娄,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,657評論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件熙卡,死亡現(xiàn)場離奇詭異杖刷,居然都是意外死亡,警方通過查閱死者的電腦和手機驳癌,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,889評論 3 394
  • 文/潘曉璐 我一進店門滑燃,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人颓鲜,你說我怎么就攤上這事表窘。” “怎么了甜滨?”我有些...
    開封第一講書人閱讀 164,057評論 0 354
  • 文/不壞的土叔 我叫張陵乐严,是天一觀的道長。 經(jīng)常有香客問我衣摩,道長昂验,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,509評論 1 293
  • 正文 為了忘掉前任昭娩,我火速辦了婚禮凛篙,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘栏渺。我一直安慰自己呛梆,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,562評論 6 392
  • 文/花漫 我一把揭開白布磕诊。 她就那樣靜靜地躺著填物,像睡著了一般。 火紅的嫁衣襯著肌膚如雪霎终。 梳的紋絲不亂的頭發(fā)上滞磺,一...
    開封第一講書人閱讀 51,443評論 1 302
  • 那天,我揣著相機與錄音莱褒,去河邊找鬼击困。 笑死,一個胖子當(dāng)著我的面吹牛广凸,可吹牛的內(nèi)容都是我干的阅茶。 我是一名探鬼主播,決...
    沈念sama閱讀 40,251評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼谅海,長吁一口氣:“原來是場噩夢啊……” “哼脸哀!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起扭吁,我...
    開封第一講書人閱讀 39,129評論 0 276
  • 序言:老撾萬榮一對情侶失蹤撞蜂,失蹤者是張志新(化名)和其女友劉穎盲镶,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體蝌诡,經(jīng)...
    沈念sama閱讀 45,561評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡溉贿,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,779評論 3 335
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了浦旱。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片顽照。...
    茶點故事閱讀 39,902評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖闽寡,靈堂內(nèi)的尸體忽然破棺而出代兵,到底是詐尸還是另有隱情,我是刑警寧澤爷狈,帶...
    沈念sama閱讀 35,621評論 5 345
  • 正文 年R本政府宣布植影,位于F島的核電站,受9級特大地震影響涎永,放射性物質(zhì)發(fā)生泄漏思币。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,220評論 3 328
  • 文/蒙蒙 一羡微、第九天 我趴在偏房一處隱蔽的房頂上張望谷饿。 院中可真熱鬧,春花似錦妈倔、人聲如沸博投。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,838評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽毅哗。三九已至,卻和暖如春捧挺,著一層夾襖步出監(jiān)牢的瞬間虑绵,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,971評論 1 269
  • 我被黑心中介騙來泰國打工闽烙, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留翅睛,地道東北人。 一個月前我還...
    沈念sama閱讀 48,025評論 2 370
  • 正文 我出身青樓黑竞,卻偏偏與公主長得像捕发,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子摊溶,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,843評論 2 354

推薦閱讀更多精彩內(nèi)容