gridsome develop Gridsome v0.7.23 Initializing plugins... Error: No transformer for ‘text/markdown
阿新 • • 發佈:2021-01-24
目錄
- 出錯現象
- 出錯原因
- 解決方案
出錯現象
這個報錯是我在使用Gridsome建立專案之後,使用md檔案作為資料匯入,用cnpm
先安裝了@gridsome/source-filesystem
外掛,為了正確編譯又引入了外掛@gridsome/transformer-remark
之後沒有起作用的問題。
> gridsome develop
Gridsome v0.7.23
Initializing plugins...
Error: No transformer for 'text/markdown' is installed.
at transformNodeContent (E: \professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]@gridsome\lib\store\transformNodeContent.js:12:13)
at SyncBailWaterfallHook.eval [as call] (eval at create (E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]-[email protected] \lib\HookCodeFactory.js:19:10), <anonymous>:5:16)
at SyncBailWaterfallHook.lazyCompileHook (E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]-[email protected]\lib\Hook.js:156:20)
at Collection.addNode (E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\ [email protected]@gridsome\lib\store\Collection.js:72:50)
at E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]_source-[email protected]@@gridsome\source-filesystem\index.js:67:36
at async Promise.all (index 1)
at async FilesystemSource.createNodes (E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]_source-[email protected]@@gridsome\source-filesystem\index.js:65:5)
at async E:\professer\lagou\Gridsome\3-4blog-with-gridsome\node_modules\[email protected]_source-[email protected]@@gridsome\source-filesystem\index.js:33:7
with-gridsome\node_modules\[email protected]@gridsome\lib\app\Plugins.js:141:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 3-4blog-with-[email protected] develop: `gridsome develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 3-4blog-with-[email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\burning\AppData\Roaming\npm-cache\_logs\2021-01-23T04_00_43_213Z-debug.log
出錯原因
cnpm安裝的問題,我之前因為無法npm安裝Gridsome所以使用了cnpm,但是可能一些依賴的環境也用了npm,總之這樣就導致了外掛安裝之後,專案無法識別。
解決方案
重新將專案使用npm i
安裝,外掛也全部時候npm安裝就可以正確使用了。