vue在服务器打包报错: --------------------------------- [INFO] npm ERR! code EINTEGRITY [INFO] npm ERR! sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g== sha1-XcB1Osv4Uhyi4PE3tFeLkXsQzyQ=. integrity checksum failed when using sha512: wanted sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g== but got sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==. (8725 bytes)
试了npm cache verify && npm cache clean --force && npm install 也不好使。 搜了半天,大概意思是npm缓存包了,sha512的串,和下载的不一样吗? --------------------------------- 打开package-lock.json,搜索: "path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmmirror.com/path-to-regexp/download/path-to-regexp-1.8.0.tgz?cache=0&sync_timestamp=1574278262588&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-1.8.0.tgz", "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g== sha1-XcB1Osv4Uhyi4PE3tFeLkXsQzyQ=.", "dev": true, "requires": { "isarray": "0.0.1" } --------------------------------- 其中integrity的值就是tgz文件的sha512和sha1值。
研究了一下: C:\Users\admin\Downloads>openssl dgst -sha512 -binary path-to-regexp-1.8.0.tgz | openssl base64 -A n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
C:\Users\admin\Downloads>openssl dgst -sha512 -binary path-to-regexp-1.9.0.tgz | openssl base64 -A xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==
C:\Users\admin\Downloads>openssl dgst -sha512 -binary path-to-regexp-1.7.0.tgz | openssl base64 -A nifX1uj4S9IrK/w3Xe7kKvNEepXivANs9ng60Iq7PU/BlouV3yL/VUhFqTuTq33ykwUqoNcTeGo5vdOBP4jS/Q== --------------------------------- 发现这个串是1.9.0版本的值,然后它这里写的是1.8.0.tgz,够白痴的 手动改成1.9.0,再构建就OK了
|