如何解决npm没有生成js文件,但是访问该页面时需要页面html
我的 centos8 服务器中有一个 demo.com
nuxt 项目,
我使用 npm 生成 .nuxt
目录:
[root@dodo demo.com]# npm run build
> Demo@1.0.0 build /www/wwwroot/demo.com
> NODE_ENV=production nuxt build
ℹ Production build 10:38:55
✔ Builder initialized 10:38:55
✔ Nuxt files generated 10:38:55
WARN browserslist: caniuse-lite is outdated. Please run: 10:38:56
npx browserslist@latest --update-db
✔ Client
Compiled successfully in 19.11s
✔ Server
Compiled successfully in 3.28s
Hash: 71f8ef64b1146d935171
Version: webpack 4.43.0
Time: 19112ms
Built at: 2021-06-10 10:39:15 ├F10: AM┤
Asset Size Chunks Chunk Names
../server/client.manifest.json 22.7 KiB [emitted]
01da9a8a4338015f77f5.js 915 bytes 12,4 [emitted] [immutable] pages/contact_us/index
1ffba14833e4bdf95a5c.js 483 bytes 3 [emitted] [immutable] pages/_lang/cloudservers/index
207aa5e89ad957a2f3c6.js 1.62 KiB 7 [emitted] [immutable] pages/_lang/index
2d3260d317f2f425e834.js 1.77 KiB 15,7 [emitted] [immutable] pages/index
3331db0cbf9ae49a5375.js 757 bytes 4 [emitted] [immutable] pages/_lang/contact_us/index
43776824d2c082dd6ebf.js 5.5 KiB 14,6 [emitted] [immutable] pages/dedicated_servers/index
4489ea5c0f99d0f999fb.js 641 bytes 11,3 [emitted] [immutable] pages/cloudservers/index
4c2c9e2e073184e0eb10.js 5.35 KiB 6 [emitted] [immutable] pages/_lang/dedicated_servers/index
5731055eace9dd208b58.js 988 KiB 19 [emitted] [immutable] [big] vendors.app
5ea2309f01b679fcae26.js 5.61 KiB 10,2 [emitted] [immutable] pages/cdn/index
7dbc71ae5886fb45568c.js 1.05 KiB 8 [emitted] [immutable] pages/_lang/operations/index
81ed7f54dd8bb7dbe8b9.js 1.2 KiB 16,8 [emitted] [immutable] pages/operations/index
83369477c447a3891c43.js 2.68 KiB 18 [emitted] [immutable] runtime
8e787e9d618a5003de48.js 486 bytes 5 [emitted] [immutable] pages/_lang/containers/index
LICENSES 2.27 KiB [emitted]
a906b5413b35e8c20e66.js 2.16 KiB 17,9 [emitted] [immutable] pages/promotions/index
adb6c68f15baf98d21e7.js 5.46 KiB 2 [emitted] [immutable] pages/_lang/cdn/index
aea42c0d73dca11a250f.js 2.01 KiB 9 [emitted] [immutable] pages/_lang/promotions/index
b2bb49f694004557f0db.js 188 KiB 1 [emitted] [immutable] commons.app
e59b70f7e84824d7889b.js 59.2 KiB 0 [emitted] [immutable] app
eee416780835006e0256.js 644 bytes 13,5 [emitted] [immutable] pages/containers/index
img/822014b.jpg 89.9 KiB [emitted]
img/8d21021.png 33.6 KiB [emitted]
img/a1a93c7.jpg 33.2 KiB [emitted]
img/a2dd91d.png 362 KiB [emitted] [big]
img/d4522c3.png 598 KiB [emitted] [big]
img/d75f2b5.png 16.9 KiB [emitted]
videos/0c58938.mp4 7.83 MiB [emitted] [big]
videos/9d8d441.mp4 5.12 MiB [emitted] [big]
videos/cb287d0.mp4 9 MiB [emitted] [big]
videos/e583b13.mp4 9.25 MiB [emitted] [big]
+ 2 hidden assets
Entrypoint app [big] = 83369477c447a3891c43.js b2bb49f694004557f0db.js 5731055eace9dd208b58.js e59b70f7e84824d7889b.js
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
videos/9d8d441.mp4 (5.12 MiB)
videos/e583b13.mp4 (9.25 MiB)
img/d4522c3.png (598 KiB)
img/a2dd91d.png (362 KiB)
videos/cb287d0.mp4 (9 MiB)
videos/0c58938.mp4 (7.83 MiB)
5731055eace9dd208b58.js (988 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (1000 KiB). This can impact web performance.
Entrypoints:
app (1.21 MiB)
83369477c447a3891c43.js
b2bb49f694004557f0db.js
5731055eace9dd208b58.js
e59b70f7e84824d7889b.js
Hash: f1c125b58fecbfbaa618
Version: webpack 4.43.0
Time: 3285ms
Built at: 2021-06-10 10:39:18 ├F10: AM┤
Asset Size Chunks Chunk Names
12667791963e0ea9d245.js 625 bytes 10,2 [emitted] [immutable] pages/cloudservers/index
1ef7d6c81a96c8ffe637.js 464 bytes 2 [emitted] [immutable] pages/_lang/cloudservers/index
347c4119b3e66fbb4c5a.js 775 bytes 3 [emitted] [immutable] pages/_lang/contact_us/index
60abca922a834513280c.js 2.15 KiB 8 [emitted] [immutable] pages/_lang/promotions/index
799eeb663aef4ea0d369.js 1.63 KiB 6 [emitted] [immutable] pages/_lang/index
7c3e9617dcc4c0aca732.js 5.61 KiB 1 [emitted] [immutable] pages/_lang/cdn/index
7d469cf37421bc40b04b.js 1.07 KiB 7 [emitted] [immutable] pages/_lang/operations/index
82a1eabc08a70b8e2809.js 2.3 KiB 16,8 [emitted] [immutable] pages/promotions/index
925d80aa1d1b3daff5d4.js 5.53 KiB 13,5 [emitted] [immutable] pages/dedicated_servers/index
94ed26b62699d2830429.js 628 bytes 12,4 [emitted] [immutable] pages/containers/index
99b21085a2fffb2c76f5.js 5.77 KiB 9,1 [emitted] [immutable] pages/cdn/index
e875bd84d186eead2579.js 5.38 KiB 5 [emitted] [immutable] pages/_lang/dedicated_servers/index
f1e78e1076e3e3f4dd8f.js 467 bytes 4 [emitted] [immutable] pages/_lang/containers/index
f77cbe309d9b5b390582.js 936 bytes 11,3 [emitted] [immutable] pages/contact_us/index
fc46011b6b9ff49920bc.js 1.22 KiB 15,7 [emitted] [immutable] pages/operations/index
fecbd7d89d7d1d4083cc.js 1.79 KiB 14,6 [emitted] [immutable] pages/index
server.js 254 KiB 0 [emitted] app
server.manifest.json 1020 bytes [emitted]
Entrypoint app = server.js
它产生了成功:
[root@zengcloud demo.com]# ls -al .nuxt/
all 104
drwxr-xr-x 6 www www 4096 Jun 10 10:38 .
drwxr-xr-x 14 www www 4096 Jun 10 10:38 ..
-rw-r--r-- 1 root root 4583 Jun 10 10:38 App.js
-rw-r--r-- 1 root root 98 Jun 10 10:38 bootstrap-vue.js
-rw-r--r-- 1 root root 18037 Jun 10 10:38 client.js
drwxr-xr-x 2 root root 136 Jun 10 10:38 components
drwxr-xr-x 4 root root 32 Jun 10 10:38 dist
-rw-r--r-- 1 root root 58 Jun 10 10:38 empty.js
-rw-r--r-- 1 root root 7663 Jun 10 10:38 index.js
-rw-r--r-- 1 root root 1928 Jun 10 10:38 loading.html
-rw-r--r-- 1 root root 174 Jun 10 10:38 middleware.js
drwxr-xr-x 2 root root 50 Jun 10 10:38 mixins
-rw-r--r-- 1 root root 4179 Jun 10 10:38 router.js
-rw-r--r-- 1 root root 2504 Jun 10 10:38 router.scrollBehavior.js
-rw-r--r-- 1 root root 8371 Jun 10 10:38 server.js
-rw-r--r-- 1 root root 1480 Jun 10 10:38 store.js
-rw-r--r-- 1 root root 16098 Jun 10 10:38 utils.js
drwxr-xr-x 2 root root 47 Jun 10 10:38 views
你看到的时间是我执行成功的时间。
但是当我在 Chrome 中访问 demo.com 时,找不到 12ea5675bfff21770e37.js
文件:
并且您看到 npm run build
时,没有生成它。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。