Error: Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.
- Dominant language
- JavaScript
- Stars
- 1.8k
- Forks
- 299
- PR merge metrics
- No merged PRs in 30d
Description
hexo server --debug
```bash
Error: Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.
at Object.safeLoad (/Users/username/hexo/blog/node_modules/_js-yaml@4.1.0@js-yaml/index.js:10:11)
**at getSettings (/Users/username/hexo/blog/node_modules/_hexo-admin@2.3.0@hexo-admin/api.js:44:26)**
at /Users/username/hexo/blog/node_modules/_hexo-admin@2.3.0@hexo-admin/api.js:150:14
at /Users/username/hexo/blog/node_modules/_hexo-admin@2.3.0@hexo-admin/api.js:141:7
at call (/Users/username/hexo/blog/node_modules/_connect@3.7.0@connect/index.js:239:7)
at next (/Users/username/hexo/blog/node_modules/_connect@3.7.0@connect/index.js:183:5)
at next (/Users/username/hexo/blog/node_modules/_connect@3.7.0@connect/index.js:161:14)
at jsonParser (/Users/username/hexo/blog/node_modules/_body-parser@1.19.0@body-parser/lib/types/json.js:110:7)
at call (/Users/username/hexo/blog/node_modules/_connect@3.7.0@connect/index.js:239:7)
at next (/Users/username/hexo/blog/node_modules/_connect@3.7.0@connect/index.js:183:5)
at SendStream.error (/Users/username/hexo/blog/node_modules/_serve-static@1.14.1@serve-static/index.js:121:7)
at SendStream.emit (events.js:376:20)
at SendStream.error (/Users/username/hexo/blog/node_modules/_send@0.17.1@send/index.js:270:17)
at SendStream.onStatError (/Users/username/hexo/blog/node_modules/_send@0.17.1@send/index.js:421:12)
at next (/Users/username/hexo/blog/node_modules/_send@0.17.1@send/index.js:735:16)
at onstat (/Users/username/hexo/blog/node_modules/_send@0.17.1@send/index.js:724:14)
at FSReqCallback.oncomplete (fs.js:192:21)
```
package.json
```json
"dependencies": {
"hexo": "^5.0.0",
"hexo-admin": "^2.3.0",
...
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with getSettings in api.js around line 44, as shown in the stack trace, and reproduce the problem with hexo server --debug. Verify that the js-yaml compatibility error no longer occurs and the Hexo admin server starts successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100