Skip to content

Instantly share code, notes, and snippets.

@xyzdata
Created July 5, 2017 05:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xyzdata/cc34c97380c4608919cde6899d2d24ff to your computer and use it in GitHub Desktop.
Save xyzdata/cc34c97380c4608919cde6899d2d24ff to your computer and use it in GitHub Desktop.
npm install error

npm install error

infinitered/ignite#46

    
# ant bugs

$ npm i -S antd

Installation Errors npm ERR! enoent ENOENT: no such file or directory, rename

npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

C:\Users\xiagq\AppData\Roaming\npm-cache\_logs

logs

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

image
ant-error

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

暴力解决方案!

package.json

在桌面上新建一个空文件夹,使用 package.json 进行重新安装 $ npm i
将 node_modules 所有安装的依赖包复制到项目目录下,覆盖掉原来的 node_modules!

{
    "name": "arra",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
        "antd": "^2.11.2",
        "moment": "^2.18.1",
        "prop-types": "^15.5.10",
        "react": "^15.6.1",
        "react-dom": "^15.6.1",
        "react-router-dom": "^4.1.1",
        "whatwg-fetch": "^2.0.3"
    },
    "devDependencies": {
        "react-scripts": "1.0.7"
    },
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test --env=jsdom",
        "eject": "react-scripts eject"
    }
}

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

@xyzdata
Copy link
Author

xyzdata commented Jul 5, 2017

Fetch API & JSON

https://github.com/github/fetch#json

https://cdn.xgqfrms.xyz/json/

let users = "";

const url = `https://cdn.xgqfrms.xyz/json/${users="users"}.json`;

fetch('https://cdn.xgqfrms.xyz/json/users.json')
.then(function (response) {
    return response.json();
})
.then(function (json) {
    console.log('parsed json', json);
})
.catch(function (error) {
    console.log('parsing failed', error);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment