包裹index.html无法正常工作

时间:2018-07-31 18:45:04

标签: static bundler assets parcel

我只有静态资产(css / fonts / js / img),我想使用Parcel捆绑器将其缩小并捆绑。

所有脚本和CSS都通过链接/脚本标签包含在index.html中

在这个项目中我没有使用过npm。我有一个包含静态文件的模板,因此我不必这样做。 (如果相关)

我不确定我是否正以正确的方式处理包裹,但是文档似乎非常简单,并且它还声称零配置,因此捆绑应该走了一步。

当我在命令行中输入“ Parcel index.html”时,出现以下错误,提示404:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\...\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'bootstrap.min.css',
1 verbose cli   '--save' ]
2 info using npm@5.6.0
3 info using node@v8.11.0
4 verbose npm-session 8f031dc15bf54c82
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 https://registry.npmjs.org/bootstrap.min.css 1069ms
8 silly fetchPackageMetaData error for bootstrap.min.css@latest 404 Not Found: bootstrap.min.css@latest
9 verbose stack Error: 404 Not Found: bootstrap.min.css@latest
9 verbose stack     at fetch.then.res (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
9 verbose stack     at runCallback (timers.js:794:20)
9 verbose stack     at tryOnImmediate (timers.js:752:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:729:5)
9 verbose stack From previous event:
9 verbose stack     at regFetch (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:36:6)
9 verbose stack     at fetchPackument (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:81:10)
9 verbose stack     at getManifest (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:37:10)
9 verbose stack     at manifest (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:24:10)
9 verbose stack     at Object.manifest (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\index.js:12:12)
9 verbose stack     at Object.Fetcher#manifest [as manifest] (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\protoduck\node_modules\genfun\lib\genfun.js:15:38)
9 verbose stack     at manifest (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetch.js:16:18)
9 verbose stack     at pinflight (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:24:12)
9 verbose stack     at C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
9 verbose stack From previous event:
9 verbose stack     at _inflight (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
9 verbose stack     at C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
9 verbose stack     at runCallback (timers.js:794:20)
9 verbose stack     at tryOnImmediate (timers.js:752:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:729:5)
9 verbose stack From previous event:
9 verbose stack     at inflight (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:14:40)
9 verbose stack     at Object.manifest (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:22:10)
9 verbose stack     at fetchPackageMetadata (C:\Users\...\AppData\Roaming\npm\node_modules\npm\lib\fetch-package-metadata.js:58:10)
9 verbose stack     at limited (C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\call-limit\call-limit.js:29:10)
9 verbose stack     at fs.stat (C:\Users\...\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:219:20)
9 verbose stack     at C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
9 verbose stack     at FSReqWrap.oncomplete (fs.js:152:21)
10 verbose cwd C:\Users\...\Documents\TreehouseWebsite\nova
11 verbose Windows_NT 10.0.17134
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\...\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "bootstrap.min.css" "--save"
13 verbose node v8.11.0
14 verbose npm  v5.6.0
15 error code E404
16 error 404 Not Found: bootstrap.min.css@latest
17 verbose exit [ 1, true ]

由于我之前没有指定package.json,它甚至安装了错误的库版本。

0 个答案:

没有答案