我无法升级npm
安装。
我尝试安装新版本的npm
:
1.Step
npm install npm -g
npm install npm --save-dev
2.Step
npm outdated
Package Current Wanted Latest
npm 3.5.3 3.5.4 3.5.3
的package.json
{
"name": "tiko",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
}
}
npm update
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\npm\node_modules\init-pa
ckage-json with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\npm\node_modules\npm-ins
tall-checks with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\npm\node_modules\node-gy
p with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\npm\node_modules\npmlog
with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled node_modules\npm\node_modules\read-pa
ckage-json with new installed version
npm outdated
Package Current Wanted Latest Location
npm 3.5.4 3.5.4 3.5.3 tiko
npm
更新无效吗?
答案 0 :(得分:1)
您可以使用private void ShowRoute(IEnumerable<Point> path, int size)
{
Canvas myCanvas1 = new Canvas();
Canvas myCanvas2 = new Canvas();
for (int y = 0; y <= this.map.GetLength(1)-1; y++)
{
for (int x = 0; x < this.map.GetLength(0); x++)
{
//set the initial point
if (this.searchParameters.StartLocation.Equals(new Point(x, y)))
{
myCanvas1.Background = new SolidColorBrush(Colors.Red);
myCanvas1.Height = size;
myCanvas1.Width = size;
Canvas.SetTop(myCanvas1, (y) * size);
Canvas.SetLeft(myCanvas1, (x) * size);
myParentCanvas.Children.Add(myCanvas1);
}
//set the end point
else if (this.searchParameters.EndLocation.Equals(new Point(x, y)))
{
myCanvas2.Background = new SolidColorBrush(Colors.Blue);
myCanvas2.Height = size;
myCanvas2.Width = size;
Canvas.SetTop(myCanvas2, (y) * size);
Canvas.SetLeft(myCanvas2, (x) * size);
myParentCanvas.Children.Add(myCanvas2);
}
//add the whole path to a list
else if (this.map[x, y] == true)
{
if (path.Where(p => p.X == x && p.Y == y).Any())
{
Mapa pathToGo = new Mapa();
pathToGo.x = x;
pathToGo.y = y;
Mapa.mapaCamino.Add(pathToGo);
}
}
}
}
//show the path in the map
foreach (var camino in Mapa.mapaCamino)
{
ImageBrush yellowDot = new ImageBrush();
yellowDot.ImageSource = new BitmapImage(new Uri("ms-appx:/Imagenes/pathToOz.png", UriKind.Absolute));
Canvas myCanvas3 = new Canvas();
myCanvas3.Background = yellowDot;
myCanvas3.Height = (size + 2);
myCanvas3.Width = (size + 2);
Canvas.SetTop(myCanvas3, (camino.y) * size);
Canvas.SetLeft(myCanvas3, (camino.x) * size);
myParentCanvas.Children.Add(myCanvas3);
}
showAnimation(size);
}
本身更新npm
安装。
您需要安装最新版本的npm
作为全局包:
npm